<template>
	<view>

		<view class="uni-padding-wrap uni-common-mt" v-if="showVideo">
			<view>
				<video id="myVideo" :src="src" @error="videoErrorCallback"  controls
					></video>
			</view>

		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {

				src: '',

				danmuValue: '',
				showVideo: false
			}
		},
		onReady: function(res) {
			// #ifndef MP-ALIPAY || MP-TOUTIAO
			this.videoContext = uni.createVideoContext('myVideo')
			// #endif
			// #ifdef APP-PLUS || MP-BAIDU
			setTimeout(() => {
				this.showVideo = true
			}, 350)
			// #endif
			// #ifndef APP-PLUS || MP-BAIDU
			this.showVideo = true
			// #endif
		},

		onLoad(e) {

			
			this.src = e.fIle.replace(/\\/g, '/')

		},
		methods: {
		
			videoErrorCallback: function(e) {
				console.log(e)
				uni.showModal({
					content: '视频播放出错',
					showCancel: false
				})
			},

		}
	}
</script>

<style>
	video {
		width: 690rpx;
		width: 100%;
		height: 400px;
	}
</style>